<template>
  <div>
    <h2>Counter: {{ modelValue }}</h2>
    <button @click="changeCounter">修改counter</button>
  </div>
</template>

<script setup>
  defineProps({
    modelValue: {
      type: [Number, String],
      default: 0
    }
  })

  const emits = defineEmits(["update:modelValue"])

  const changeCounter = () => {
    emits("update:modelValue", 999)
  }
</script>

